import request from '@/utils/request'
import { download } from '@/utils/request'
//获取资产信息列表
export function GetAssetsList(params) {
  return request({
    url: '/Interface/GetInStorage',
    headers: {
      isNeedFixParmas: true,
    },
    method: 'post',
    data: params,
  })
}

//添加或编辑资产信息
export function AddOrEditAssets(params) {
  return request({
    url: '/Interface/SaveInStorage',
    headers: {
      isNeedFixParmas: true,
    },
    method: 'post',
    data: params,
  })
}

//获取打印模板
export function GetPrinterTempList(params) {
  return request({
    url: '/basic/GetReportInfo',
    headers: {
      isNeedFixParmas: true,
    },
    method: 'post',
    data: params,
  })
}

//打印提交

export function PrintFasAssets(params) {
  return request({
    url: '/Interface/PrintFasAssets',
    headers: {
      isNeedFixParmas: true,
    },
    method: 'post',
    data: params,
  })
}

//资产导入
export function ImportAssets(params) {
  return request({
    url: '/Interface/AssetInitialization',
    headers: {
      isNeedFixParmas: false,
      'Content-Type': 'multipart/form-data',
    },
    method: 'post',
    data: params,
  })
}

export function DownloadAssetsExcel(
  url,
  params,
  filename,
  method = 'GET',
  config = {}
) {
  return download(url, params, filename, method, config)
}
